package com.sg.service.impl;

import com.sg.bean.Shop;
import com.sg.dao.ShopDao;
import com.sg.service.ShopService;
import com.sg.vo.ShopVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fyp
 * 购物车业务逻辑实现类
 */
@Service
public class ShopServiceImpl implements ShopService {

    @Autowired
    ShopDao shopDao;
    @Override
    public ShopVO findById(int shopId) {
        return shopDao.findById(shopId);
    }

    @Override
    public List<ShopVO> findByUidAndBusinessId(int uId, int businessId) {
        return shopDao.findByUidAndBusinessId(uId,businessId);
    }

    @Override
    public Shop findByUidAndBusinessIdShop(int uId, int businessId) {
        return shopDao.findByUidAndBusinessIdShop(uId,businessId);
    }

    @Override
    public boolean add(Shop shop) {
        return shopDao.add(shop)>0?true:false;
    }
}
